package com.lineage.data.item_etcitem.add;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1MonsterInstance;
import com.lineage.server.model.Instance.L1NpcInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.L1Object;
import com.lineage.server.serverpackets.S_NPCTalkReturn;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import com.lineage.server.world.World;

public class Ajplayer extends ItemExecutor {
  public static ItemExecutor get() {
    return new Ajplayer();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    int spellsc_objid = data[0];
    sneakpeek(pc, spellsc_objid, item);
  }
  
  private void sneakpeek(L1PcInstance pc, int targetId, L1ItemInstance item) {
    L1Object target = World.get().findObject(targetId);
    if (target != null) {
      String msg0 = "";
      String msg2 = "";
      String msg3 = "";
      String msg4 = "";
      String msg5 = "";
      String msg6 = "";
      String msg7 = "";
      String msg8 = "";
      String msg9 = "";
      String msg10 = "";
      String msg11 = "";
      String msg12 = "";
      String msg13 = "";
      String msg14 = "";
      String msg15 = "";
      String msg16 = "";
      String msg17 = "";
      String msg18 = "";
      String msg19 = "";
      String msg20 = "";
      String msg21 = "";
      String msg22 = "";
      String msg23 = "";
      String msg24 = "";
      String msg25 = "";
      String msg26 = "";
      String msg27 = "";
      String msg28 = "";
      String msg29 = "";
      String msg30 = "";
      String msg31 = "";
      String msg32 = "";
      String msg33 = "";
      String msg34 = "";
      String msg35 = "";
      String msg36 = "";
      String msg37 = "";
      String msg38 = "";
      String msg39 = "";
      String msg40 = "";
      String msg41 = "";
      String msg42 = "";
      String msg43 = "";
      String msg44 = "";
      String msg45 = "";
      String msg46 = "";
      if (target instanceof L1PcInstance) {
        L1PcInstance target_pc = (L1PcInstance)target;
        L1ItemInstance item2 = target_pc.getInventory().getItemEquipped(2, 1);
        L1ItemInstance item3 = target_pc.getInventory().getItemEquipped(2, 2);
        L1ItemInstance item4 = target_pc.getInventory().getItemEquipped(2, 3);
        L1ItemInstance item5 = target_pc.getInventory().getItemEquipped(2, 4);
        L1ItemInstance item6 = target_pc.getInventory().getItemEquipped(2, 5);
        L1ItemInstance item7 = target_pc.getInventory().getItemEquipped(2, 6);
        L1ItemInstance item8 = target_pc.getInventory().getItemEquipped(2, 7);
        L1ItemInstance item9 = target_pc.getInventory().getItemEquipped(2, 8);
        L1ItemInstance item10 = target_pc.getInventory().getItemEquipped(2, 9);
        L1ItemInstance item11 = target_pc.getInventory().getItemEquipped(2, 10);
        L1ItemInstance item12 = target_pc.getInventory().getItemEquipped(2, 12);
        L1ItemInstance item13 = target_pc.getInventory().getItemEquipped(2, 40);
        L1ItemInstance item14 = target_pc.getInventory().getItemEquipped(2, 13);
        L1ItemInstance item15 = target_pc.getInventory().getItemEquipped(2, 14);
        L1ItemInstance item16 = target_pc.getInventory().getItemEquipped(2, 15);
        L1ItemInstance item17 = target_pc.getInventory().getItemEquipped(2, 16);
        L1ItemInstance item18 = target_pc.getInventory().getItemEquipped(2, 17);
        L1ItemInstance item19 = target_pc.getInventory().getItemEquipped(2, 18);
        L1ItemInstance item20 = target_pc.getInventory().getItemEquipped(2, 19);
        L1ItemInstance item21 = target_pc.getInventory().getItemEquipped(2, 20);
        L1ItemInstance item22 = target_pc.getInventory().getItemEquipped(2, 11);
        L1ItemInstance item23 = target_pc.getInventory().getItemEquipped(2, 23);
        if (target_pc.getInventory().getItemEquipped(2, 1) != null) {
          msg13 = "+" + item2.getEnchantLevel() + " " + item2.getName();
        } else {
          msg13 = "无装备头盔";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 2) != null) {
          msg14 = "+" + item3.getEnchantLevel() + " " + item3.getName();
        } else {
          msg14 = "无装备盔甲";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 3) != null) {
          msg15 = "+" + item4.getEnchantLevel() + " " + item4.getName();
        } else {
          msg15 = "无装备T恤";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 4) != null) {
          msg16 = "+" + item5.getEnchantLevel() + " " + item5.getName();
        } else {
          msg16 = "无装备斗篷";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 5) != null) {
          msg17 = "+" + item6.getEnchantLevel() + " " + item6.getName();
        } else {
          msg17 = "无装备手套";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 6) != null) {
          msg18 = "+" + item7.getEnchantLevel() + " " + item7.getName();
        } else {
          msg18 = "无装备长靴";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 7) != null) {
          msg19 = "+" + item8.getEnchantLevel() + " " + item8.getName();
        } else {
          msg19 = "无装备盾牌";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 8) != null) {
          msg20 = "+" + item9.getEnchantLevel() + " " + item9.getName();
        } else {
          msg20 = "无装备项链";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 9) != null) {
          msg21 = "+" + item10.getEnchantLevel() + " " + item10.getName();
        } else {
          msg21 = "无装备戒指1(9)";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 11) != null) {
          msg22 = "+" + item22.getEnchantLevel() + " " + item22.getName();
        } else {
          msg22 = "无装备戒指2(11)";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 11) != null) {
          msg23 = "+" + item22.getEnchantLevel() + " " + item22.getName();
        } else {
          msg23 = "无装备戒指3(11)";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 23) != null) {
          msg24 = "+" + item23.getEnchantLevel() + " " + item23.getName();
        } else {
          msg24 = "无装备戒指4(23)";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 10) != null) {
          msg25 = "+" + item11.getEnchantLevel() + " " + item11.getName();
        } else {
          msg25 = "无装备腰带";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 12) != null) {
          msg26 = "+" + item12.getEnchantLevel() + " " + item12.getName();
        } else {
          msg26 = "无装备耳环1";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 40) != null) {
          msg27 = "+" + item13.getEnchantLevel() + " " + item13.getName();
        } else {
          msg27 = "无装备耳环2";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 13) != null) {
          msg28 = "+" + item14.getEnchantLevel() + " " + item14.getName();
        } else {
          msg28 = "无装备臂甲";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 14) != null) {
          msg29 = "+" + item15.getEnchantLevel() + " " + item15.getName();
        } else {
          msg29 = "无装备符石 左";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 15) != null) {
          msg30 = "+" + item16.getEnchantLevel() + " " + item16.getName();
        } else {
          msg30 = "无装备符石 右";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 16) != null) {
          msg31 = "+" + item17.getEnchantLevel() + " " + item17.getName();
        } else {
          msg31 = "无装备符石 中";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 17) != null) {
          msg32 = "+" + item18.getEnchantLevel() + " " + item18.getName();
        } else {
          msg32 = "无装备胫甲";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 18) != null) {
          msg33 = "+" + item19.getEnchantLevel() + " " + item19.getName();
        } else {
          msg33 = "无装备六芒星护身符系列";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 19) != null) {
          msg34 = "+" + item20.getEnchantLevel() + " " + item20.getName();
        } else {
          msg34 = "无装备蒂蜜特的纹样系列";
        } 
        if (target_pc.getInventory().getItemEquipped(2, 20) != null) {
          msg35 = "+" + item21.getEnchantLevel() + " " + item21.getName();
        } else {
          msg35 = "无装备蒂蜜特的符文";
        } 
        msg0 = target_pc.getName();
        int i = target_pc.getLevel();
        msg3 = String.valueOf(target_pc.getCurrentHp()) + " / " + target_pc.getMaxHp();
        msg4 = String.valueOf(target_pc.getCurrentMp()) + " / " + target_pc.getMaxMp();
        int j = target_pc.getAc();
        int k = target_pc.getEr();
        msg7 = String.valueOf(target_pc.getMr()) + " %";
        msg8 = String.valueOf(target_pc.getFire()) + " %";
        msg9 = String.valueOf(target_pc.getWater()) + " %";
        msg10 = String.valueOf(target_pc.getWind()) + " %";
        msg11 = String.valueOf(target_pc.getEarth()) + " %";
        short s1 = target_pc.getStr();
        short s2 = target_pc.getCon();
        short s3 = target_pc.getDex();
        short s4 = target_pc.getWis();
        short s5 = target_pc.getInt();
        short s6 = target_pc.getCha();
        msg42 = "0";
        int m = target_pc.getGfxId();
        long l = target_pc.getExp();
        int n = target_pc.getLawful();
        int i1 = target_pc.getSp();
        L1ItemInstance weapon = target_pc.getWeapon();
        if (weapon != null) {
          msg12 = weapon.getLogName();
        } else {
          msg12 = "无装备武器";
        } 
        String[] msg47 = { 
            msg0, ""+i, msg3, msg4, ""+j, ""+k, msg7, msg8, msg9, msg10, 
            msg11, msg12, 
            msg13, msg14, msg15, msg16, msg17, msg18, msg19, msg20, 
            msg21, msg22, msg23, msg24, msg25, 
            msg26, msg27, msg28, msg29, msg30, 
            msg31, msg32, msg33, msg34, msg35, ""+s1, ""+s2, ""+s3, 
            ""+s4, ""+s5, 
            ""+s6, msg42, ""+m, ""+l, ""+n, ""+i1 };
        pc.sendPackets((ServerBasePacket)new S_NPCTalkReturn(pc.getId(), "ajplayer", msg47));
        pc.getInventory().removeItem(item, 1L);
      } else if (pc.isGm()) {
        L1NpcInstance target_npc = null;
        if (target instanceof L1MonsterInstance) {
          L1MonsterInstance l1MonsterInstance = (L1MonsterInstance)target;
        } else if (target instanceof L1NpcInstance) {
          target_npc = (L1NpcInstance)target;
        } 
        msg0 = target_npc.getName();
        int i = target_npc.getLevel();
        msg3 = String.valueOf(target_npc.getCurrentHp()) + " / " + target_npc.getMaxHp();
        msg4 = String.valueOf(target_npc.getCurrentMp()) + " / " + target_npc.getMaxMp();
        int j = target_npc.getAc();
        msg6 = "0";
        msg7 = String.valueOf(target_npc.getMr()) + " %";
        msg8 = String.valueOf(target_npc.getFire()) + " %";
        msg9 = String.valueOf(target_npc.getWater()) + " %";
        msg10 = String.valueOf(target_npc.getWind()) + " %";
        msg11 = String.valueOf(target_npc.getEarth()) + " %";
        msg12 = "砂锅大的拳头";
        short s1 = target_npc.getStr();
        short s2 = target_npc.getCon();
        short s3 = target_npc.getDex();
        short s4 = target_npc.getWis();
        short s5 = target_npc.getInt();
        short s6 = target_npc.getCha();
        int k = target_npc.getNpcId();
        int m = target_npc.getGfxId();
        long l = target_npc.getExp();
        int n = target_npc.getLawful();
        int i1 = target_npc.getSp();
        String[] msg48 = { 
            msg0, ""+i, msg3, msg4, ""+j, msg6, msg7, msg8, msg9, msg10, 
            msg11, msg12, 
            ""+s1, ""+s2, ""+s3, ""+s4, ""+s5, ""+s6, ""+k,""+m, 
            ""+l, ""+n, ""+i1 };
        pc.sendPackets((ServerBasePacket)new S_NPCTalkReturn(pc.getId(), "ajplayer", msg48));
        pc.getInventory().removeItem(item, 1L);
      } else {
        pc.sendPackets((ServerBasePacket)new S_ServerMessage(79));
      } 
    } 
  }
}
